package gtgold;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;

import javax.imageio.ImageIO;
import javax.swing.*;

/**
 * Background Image Panel
 * 
 * @author jen
 */
public class bgImagePanel extends JPanel
{
	private static final long serialVersionUID = 1L;
	private BufferedImage theBgImage;

	/**
	 * Create the panel.
	 */
	public bgImagePanel(String filename)
	{
		try
		{
			theBgImage = ImageIO.read(new File(filename));
		} catch (IOException e)
		{
			e.printStackTrace();
		}
		setLayout(new GridLayout(1, 1));
	}

	// overwrites default
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		g.drawImage(theBgImage, 0, 0, null);
	}

}